import request from '@/utils/request';

// 探针采集配置管理

// 查询探针采集配置列表
export function pageInfo(data: any): ApiPromise<ApiResponse> {
	return request({
		url: '/management/probeManage/pageInfo',
		method: 'post',
		data: data,
		headers: {
			version: 'dengfazhu',
		},
	});
}

//根据Id查询探针采集配置
export function detail(id: any): ApiPromise<ApiResponse> {
	return request({
		url: '/management/probeManage/detail/' + id,
		method: 'get',
	});
}

// 增加探针采集配置
export function save(data: any): ApiPromise<ApiResponse> {
	return request({
		url: '/management/probeManage/save',
		method: 'post',
		data: data,
	});
}

// 修改探针采集配置
export function updateDetail(data: any): ApiPromise<ApiResponse> {
	return request({
		url: '/management/probeManage/updateDetail',
		method: 'post',
		data: data,
	});
}

//批量删除
export function delProbe(ids: any): ApiPromise<ApiResponse> {
	return request({
		url: '/management/probeManage/delProbe/' + ids,
		method: 'delete',
	});
}

// 同步业务配置
export function syncBusiness(data: any): ApiPromise<ApiResponse> {
	return request({
		url: '/management/probeManage/syncBusiness',
		method: 'post',
		data: data,
		timeout: 999999999,
	});
}

// 同步ip过滤配置
export function syncIp(data: any): ApiPromise<ApiResponse> {
	return request({
		url: '/management/probeManage/syncIp',
		method: 'post',
		data: data,
	});
}

// 清空ip过滤配置
export function cleanIp(data: any): ApiPromise<ApiResponse> {
	return request({
		url: '/management/probeManage/cleanIp',
		method: 'post',
		data: data,
	});
}

// 修改状态
export function updateStatus(data: any): ApiPromise<ApiResponse> {
	return request({
		url: '/management/probeManage/updateStatus',
		method: 'post',
		data: data,
		headers: {
			version: 'dengfazhu',
		},
	});
}

//查询运行情况
export function running(id: any): ApiPromise<ApiResponse> {
	return request({
		url: '/management/probeManage/running/' + id,
		method: 'get',
	});
}

// 查看探针接口信息
export function interfaceList(data: any): ApiPromise<ApiResponse> {
	return request({
		url: '/management/probeInterface/interfaceList',
		method: 'post',
		data: data,
	});
}

// 查询探针协议信息
export function protocolPage(data: any): ApiPromise<ApiResponse> {
	return request({
		url: '/management/probeManage/protocolPage',
		method: 'post',
		data: data,
	});
}

//根据ip更新探针协议
export function syncProtocol(ip: string): ApiPromise<ApiResponse> {
	return request({
		url: '/management/probeManage/syncProtocol/' + ip,
		method: 'get',
	});
}
